package com.talent.jiwen_teacher.base;

import android.support.v7.widget.RecyclerView;
import android.view.View;


public abstract class BaseViewHolder<D> extends RecyclerView.ViewHolder {
    private D data;

    public BaseViewHolder(View itemView) {
        super(itemView);
    }

    public BaseViewHolder setData(Object d){
        data = (D)d;
        onDataSet(data);
        return this;
    }

    public D getData(){
        return data;
    }

    protected abstract void onDataSet(D d);

}